Expand description
A crate for parsing Bib(La)TeX files.
The main API entrypoint is the Bibliography
struct.
§Example
Finding out the author of a work.
let src = "@book{tolkien1937, author = {J. R. R. Tolkien}}";
let bibliography = Bibliography::parse(src).unwrap();
let entry = bibliography.get("tolkien1937").unwrap();
let author = entry.author().unwrap();
assert_eq!(author[0].name, "Tolkien");
Structs§
- A fully parsed bibliography.
- A date or a range of dates and their certainty and exactness.
- Timezone-unaware date and time.
- A bibliography entry containing chunk fields, which can be parsed into more specific types on demand.
- The keys for fields and their values.
- An error that might occur during initial parsing of the bibliography.
- An author, editor, or some other person affiliated with a cited work.
- A literal representation of a bibliography file, with abbreviations not yet resolved.
- A raw extracted entry, with abbreviations not yet resolved.
- A report of the validity of an
Entry
. Can be obtained by callingEntry::verify
. - A value with the span it corresponds to in the source code.
- A potentially timezone aware time.
- An error that may occur while parsing the chunks in a field into a specific
Type
.
Enums§
- Represents one part of a field value.
- A single date or a range of dates.
- Which role the according editor had.
- Describes the type of a bibliographical entry.
- Gender of the author or editor (if no author was specified).
- Defines the pagination scheme to use for formatting purposes.
- Error conditions that might occur during initial parsing of the bibliography.
- A value that could be either a typed value or a literal string.
- A literal representation of a bibliography entry field.
- Errors that can occur when retrieving a field of an
Entry
. - A timezone offset.
- A token that can be encountered during parsing.
- Error conditions that might occur while parsing the chunks in a field into a specific
Type
.
Traits§
- Additional methods for chunk slices.
- Convert Bib(La)TeX data types from and to chunk slices.
Functions§
- Parse a colon.
- Parse a hyphen.
Type Aliases§
- A vector of chunks.
- A slice of chunks.
- The content of a field or abbreviation.